package com.zhentao.dto;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * AI消息数据传输对象
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class AiMessageDTO {
    
    private String id;
    private String conversationId;
    private String content;
    private String messageType;
    private LocalDateTime timestamp;
    private Integer sequenceNumber;
    private String status;
    private Boolean isSystem;
    private String aiModel;
    private Long responseTime;
    
    /**
     * 简化构造函数 - 用于前端显示
     */
    public AiMessageDTO(String id, String content, String messageType, LocalDateTime timestamp) {
        this.id = id;
        this.content = content;
        this.messageType = messageType;
        this.timestamp = timestamp;
    }
    
    /**
     * 判断是否为用户消息
     */
    public boolean isUserMessage() {
        return "USER".equals(this.messageType);
    }
    
    /**
     * 判断是否为AI回复
     */
    public boolean isAssistantMessage() {
        return "ASSISTANT".equals(this.messageType);
    }
}
